package com.sdutcm.Mapper;

/*
 *@Author Yan
 *@Create 2019-08-21 15:02
 */

import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ClassMapper {

    // 小于10周
    @Select("SELECT allclass.上课教室 FROM allclass WHERE allclass.上课教室 NOT IN (SELECT 上课教室 FROM class WHERE 星期几= #{weekday} AND (节次 = ${session})AND (单双周 = #{danshuang} OR 单双周 IS NULL) AND (起止周 REGEXP '[1-${week}]-[${week}-9]' OR 起止周 REGEXP '[1-${week}]-1[0-8]') AND 校区='1')")
    public List<String> classfindmin(Integer week,String weekday,String session,String danshuang) throws Exception;

    // 大于10周
    @Select("SELECT allclass.上课教室 FROM allclass WHERE allclass.上课教室 NOT IN (SELECT 上课教室 FROM class WHERE 星期几=#{weekday} AND (节次 = ${session})AND (单双周 = #{danshuang} OR 单双周 IS NULL) AND (起止周 REGEXP '[1-9]-1[${week}-8]' OR 起止周 REGEXP '1[${week}-8]-1[0-8]') AND 校区='1')")
    public List<String> classfindmax(Integer week,String weekday,String session,String danshuang) throws Exception;
}
